package org.fkit.controller;

import java.io.IOException;
import java.net.InetAddress;

import javax.annotation.PostConstruct;

import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * Startup
 * 
 * @author 00fly
 * @version [版本号, 2018-09-26]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Slf4j
@Component
public class Startup
{
    @PostConstruct
    public void init()
    {
        try
        {
            log.info("now open Browser...");
            String ip = InetAddress.getLocalHost().getHostAddress();
            String url = "http://" + ip + ":8080";
            Runtime.getRuntime().exec("cmd /c start /min " + url + "/registerForm");
        }
        catch (IOException e)
        {
            log.error(e.getMessage(), e);
        }
    }
}
